Debian重启命令

您所在的位置:网站首页 Linux重启网卡驱动 命令 Debian重启命令

Debian重启命令

#Debian重启命令| 来源: 网络整理| 查看: 265

Debian重启命令

4cbdd6b802aca8b1c000b26e09a9b4b9.png

ethtool用于查看和修改网络设备(尤其是有线以太网设备)的驱动参数和硬件设置。

ethtool用于查看和修改网络设备(尤其是有线以太网设备)的驱动参数和硬件设置。 您可以根据需要更改以太网卡的参数,包括自动协商、速度、双工和局域网唤醒等参数。 通过配置以太网卡,您的计算机可以有效地通过网络进行通信。 这个工具提供了很多关于连接到你的 Linux 系统的以太网设备的信息。

在本文中,我们将告诉您如何更改以下参数以及如何查看它们。 本文将帮助您解决 Linux 系统中与以太网卡相关的问题。

以下信息将帮助您了解以太网卡的工作原理。

如何在 Linux 上安装 ethtool

默认情况下,ethtool 应该已经安装在大多数系统上。 如果没有,您可以从发行版的官方存储库安装它。

RHEL/CentOS 6/7系统,使用yum命令安装ethtool:

$ sudo yum install -y ethtool

对于RHEL/CentOS 8和Fedora系统,使用dnf命令安装ethtool:

$ sudo yum install -y ethtool

对于基于 Debian 的系统,使用 apt 命令或 apt-get 命令安装 ethtool:

$ sudo apt-get install ethtool

对于 openSUSE 系统,使用 zypper 命令安装 ethtool:

$ sudo zypper install -y ethtool

对于 Arch Linux 系统,使用 pacman 命令安装 ethtool:

$ sudo pacman -S ethtool

如何在 Linux 上检查可用的网络接口

您可以使用 ip 命令或 ifconfig 命令(在现代发行版中已过时)来验证可用的活动网卡的名称和其他详细信息:

# ip a或# ifconfig1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever2: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:10:22:35:23:sf brd ff:ff:ff:ff:ff:ff inet 192.164.23.100/24 brd 192.164.23.255 scope global eth0

以太坊和以太经典是什么关系_以太经典和以太坊统一_以太坊重启

valid_lft forever preferred_lft forever

如何在 Linux 上检查网络接口卡 (NIC) 信息

获得以太网卡名称后以太坊重启,您可以使用 ethtool 命令轻松查看其详细信息,如下所示。

在 Linux 系统中,每个网络接口卡 (NIC) 都分配有一个唯一的名称,例如 ethX、enpXXX 等。

# ethtool eth0Settings for eth0: Supported ports: [ TP ] Supported link modes: 1000baseT/Full 10000baseT/Full Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 10000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: off MDI-X: Unknown Supports Wake-on: uag Wake-on: d Link detected: yes

如何查看以太网卡的驱动程序和固件版本

您可以使用 ethtool 命令的 -i 选项检查驱动程序版本、固件版本和总线详细信息,如下所示:

以太坊和以太经典是什么关系_以太坊重启_以太经典和以太坊统一

# ethtool -i eth0driver: vmxnet3version: 1.4.16.0-k-NAPIfirmware-version:expansion-rom-version:bus-info: 0000:0b:00.0supports-statistics: yessupports-test: nosupports-eeprom-access: nosupports-register-dump: yessupports-priv-flags: no

如何检查网络使用统计

您可以在 ethtool 命令中使用 -S 选项来查看网络使用情况统计信息。 它可以显示发送的字节数、接收的字节数、错误数等。

# ethtool -S eth0NIC statistics: Tx Queue#: 0 TSO pkts tx: 2053 TSO bytes tx: 7167572 ucast pkts tx: 4028081 ucast bytes tx: 399093197 mcast pkts tx: 0 mcast bytes tx: 0 bcast pkts tx: 0 bcast bytes tx: 0 pkts tx err: 0 pkts tx discard: 0 drv dropped tx total: 0

以太坊重启_以太经典和以太坊统一_以太坊和以太经典是什么关系

too many frags: 0 giant hdr: 0 hdr err: 0 tso: 0 ring full: 0 pkts linearized: 0 hdr cloned: 0 giant hdr: 0 Tx Queue#: 1 TSO pkts tx: 1955 TSO bytes tx: 6536945 ucast pkts tx: 3711838 ucast bytes tx: 346309662 mcast pkts tx: 0 mcast bytes tx: 0 bcast pkts tx: 1186 bcast bytes tx: 49812 pkts tx err: 0 pkts tx discard: 0 drv dropped tx total: 0 too many frags: 0 giant hdr: 0 hdr err: 0 tso: 0 ring full: 0 pkts linearized: 0 hdr cloned: 0 giant hdr: 0 Rx Queue#: 0

以太坊重启_以太经典和以太坊统一_以太坊和以太经典是什么关系

LRO pkts rx: 0 LRO byte rx: 0 ucast pkts rx: 5084776 ucast bytes rx: 4673133395 mcast pkts rx: 0 mcast bytes rx: 0 bcast pkts rx: 154143 bcast bytes rx: 45415676 pkts rx OOB: 0 pkts rx err: 0 drv dropped rx total: 0 err: 0 fcs: 0 rx buf alloc fail: 0 Rx Queue#: 1 LRO pkts rx: 0 LRO byte rx: 0 ucast pkts rx: 6346769 ucast bytes rx: 4835534292 mcast pkts rx: 0 mcast bytes rx: 0 bcast pkts rx: 3464 bcast bytes rx: 714646 pkts rx OOB: 0 pkts rx err: 0 drv dropped rx total: 0 err: 0 fcs: 0 rx buf alloc fail: 0

以太坊重启_以太经典和以太坊统一_以太坊和以太经典是什么关系

tx timeout count: 0

如何改变以太网设备的速度

您可以根据需要更改以太网速度。 进行此更改时,网卡将自动脱机,您需要使用 ifup 命令或 ip 命令或 nmcli 命令将其恢复。

# ethtool -s eth0 speed 100# ip link set eth0 up

如何在 Linux 上启用/禁用以太网卡的自动协商?

您可以使用 ethtool 命令中的 autoneg 选项启用或禁用自动协商以太坊重启,如下图所示:

# ethtool -s eth0 autoneg off# ethtool -s eth0 autoneg on

如何同时更改多个参数

如果要使用ethtool命令同时更改网卡的多个参数,请使用如下格式:

Syntax:ethtool –s [device_name] speed [10/100/1000] duplex [half/full] autoneg [on/off]# ethtool –s eth0 speed 1000 duplex full autoneg off

如何检查特定 NIC 的自动协商、RX 和 TX

要查看特定以太网设备的自动协商等详细信息,请使用以下格式:

# ethtool -a eth0

如何从多个设备中识别出特定的网卡(闪烁网卡上的 LED)

如果您想识别特定的物理接口,此选项很有用。 以下 ethtool 命令将使 eth0 端口上的 LED 闪烁:

# ethtool -p eth0

如何在 Linux 中永久设置这些参数

默认情况下,您使用 ethtool 所做的更改将在系统重启后恢复。

要使自定义设置永久生效,您需要更新网络配置文件中的值。 根据您的 Linux 发行版,您可能需要将此值更新为正确的文件。

对于基于 RHEL 的系统。 您必须使用 ETHTOOL_OPTS 变量:

# vi /etc/sysconfig/network-scripts/ifcfg-eth0ETHTOOL_OPTS="speed 1000 duplex full autoneg off"

对于基于 Debian 的系统:

# vi /etc/network/interfacespost-up ethtool -s eth0 speed 1000 duplex full autoneg off


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3